The present invention relates to a priority encoder for resolving priority contention between channels requesting simultaneous service. More particularly, the present invention relates to a priority encoder capable of fixed priority encoding and rotating priority encoding.
A conventional priority encoder, the 8237A Programmable DMA Controller, is described at pages 2-222 through 2-240 of an October, 1987 Intel manual under the heading, "8237A HIGH PERFORMANCE PROGRAMMABLE DMA CONTROLLER". This priority encoder determines, according to a priority order, a peripheral circuit or channel which can obtain direct memory access (DMA) from system memory when a plurality of the system's peripheral circuits or channels simultaneously request a DMA service, i.e., when a priority contention occurs. When a peripheral circuit or channel obtains service, other peripheral circuits or channels having lower priority are prevented from interfering with the service until the service to the higher priority channel is completed.
Two types of priority encoding are available to the user of the priority encoder. The first is fixed priority encoding in which the one channel to obtain service is selected from a plurality of channels in a predetermined priority order. For instance, if there are first to fourth channels simultaneously requesting service, the first channel always has the highest priority, followed by the second and third channels, the fourth channel always has the lowest priority.
The second type for priority encoding is rotating priority encoding in which the last channel obtaining service becomes the lowest priority channel. In case of the rotating priority encoding, any channel requesting service will obtain service after service to not more than three higher priority channels are completed. This prevents any one channel from monopolizing the service.
When the conventional priority encoder changes its operating mode from the rotating priority mode for the rotating priority encoding to a fixed priority mode for the fixed priority encoding and then back into the rotating priority mode, the last channel obtaining service in the fixed priority mode, becomes the lowest priority channel and, therefore, the next lower priority channel in the fixed priority order to that last channel obtains service. For example, when the priority mode is changed from rotating to fixed after the third channel obtains service, the priority encoder grants the next service to the first channel which has the highest priority in the fixed priority mode. If the priority mode is then changed to the rotating priority mode after service to the first channel is completed, the priority encoder grants service to the second channel since the second channel has the highest priority after service to the first channel in the rotating priority mode.
Thus, the channel about to obtain service after the third channel in the rotating mode previous to the fixed mode, i.e., the fourth channel, cannot obtain service for a long period of time. Thus, the conventional priority encoder is disadvantageous in that bus latency of a particular channel may become long when the priority mode is changed.